Skip to content

fix(dashboards): Resolve static-component-definitions in GenericFilterSelector#120033

Merged
ryan953 merged 1 commit into
masterfrom
seer/fix/dashboards-static-component-definitions
Jul 21, 2026
Merged

fix(dashboards): Resolve static-component-definitions in GenericFilterSelector#120033
ryan953 merged 1 commit into
masterfrom
seer/fix/dashboards-static-component-definitions

Conversation

@sentry

@sentry sentry Bot commented Jul 19, 2026

Copy link
Copy Markdown
Contributor

This PR addresses the static-component-definitions violation reported in static/app/views/dashboards/globalFilter/genericFilterSelector.tsx.

The issue stemmed from calling the getFilterSelector function inside the GenericFilterSelector component's render method. Although getFilterSelector returned a stable, module-level component reference (NumericFilterSelector or FilterSelector), the act of calling a function to determine the component type during render caused React to perceive a new component type on each render. This leads to unnecessary unmounting/remounting of the component subtree, state resets, and blocks React Compiler optimizations.

The fix involves removing the getFilterSelector helper function and inlining its logic directly into the GenericFilterSelector component. By using a conditional (isNumericType ? NumericFilterSelector : FilterSelector) to assign the component to a local variable, we ensure that the component reference used in JSX is always a stable, module-level component, satisfying the static-component-definitions rule.

Legal Boilerplate

Look, I get it. The entity doing business as "Sentry" was incorporated in the State of Delaware in 2015 as Functional Software, Inc. and is gonna need some rights from me in order to utilize my contributions in this here PR. So here's the deal: I retain all rights, title and interest in and to my contributions, and by keeping this boilerplate intact I confirm that Sentry can use, modify, copy, and redistribute my contributions, under Sentry's choice of terms.

Fixes CODING-CONVENTIONS-359

Comment @sentry <feedback> on this PR to have Autofix iterate on the changes.

@sentry
sentry Bot requested a review from a team as a code owner July 19, 2026 19:55
@github-actions github-actions Bot added the Scope: Frontend Automatically applied to PRs that change frontend components label Jul 19, 2026
@ryan953 ryan953 added the Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests label Jul 21, 2026
@ryan953
ryan953 enabled auto-merge (squash) July 21, 2026 15:14
@ryan953
ryan953 merged commit 3d86d47 into master Jul 21, 2026
86 of 87 checks passed
@ryan953
ryan953 deleted the seer/fix/dashboards-static-component-definitions branch July 21, 2026 15:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Scope: Frontend Automatically applied to PRs that change frontend components Trigger: getsentry tests Once code is reviewed: apply label to PR to trigger getsentry tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant